<?php
require_once dirname(__FILE__).'/UserService.php';

session_start(); 
$loginname = @$_POST['loginname'];
$password = @$_POST['password'];
if (!empty($loginname) && !empty($password)) {
    $service = new UserService();
    if ($service->auth($loginname, $password)) {
        $_SESSION['user'] = $loginname;
        header("location:menu.php");
    }
}

?>
<form method="post">
	<span class="txt">用户：</span>
	<span class="ipt"><input type="text" id="loginname" name="loginname" value=""/></span>
	<span class="txt">密码：</span>
	<span class="ipt"><input type="password" id="password" name="password" value="" /></span>
	<span class="btn"><input type="submit" value="登录" /></span>
</form>